<?
class My_View_Helper_MenuLink
{
    public $view;
    private $user;
    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }

    public function menuLink(){
        $link = '';
        if(Zend_Auth::getInstance()->hasIdentity()) {
		    $this->user = Zend_Auth::getInstance()->getIdentity();            
		    if(!is_object($this->user)){
			    return $link;
		    }
            $link .= '<a href="' . $this->view->url(array('controller' => 'participant','action' => 'profile'), 'default', true) . '"> ' . $this->view->translate('profile') . '</a>&nbsp';
            $link .= '<a href="' . $this->view->url(array('controller' => 'paper','action' => 'upload'),'default', true) . '">' . $this->view->translate('submit') . '</a>&nbsp';
            $link .= '<a href="' . $this->view->url(array('controller' => 'paper','action' => 'posted'),'default', true) . '">' . $this->view->translate('posted') . '</a>&nbsp';
		
            if($this->user->isReviewer == 1){
                $link .= '<a href="' . $this->view->url(array('controller' => 'review','action' => 'assigned'), 'default', true) . '">' . $this->view->translate('review') . '</a>';
            }
            if(in_array($this->user->email, Zend_Registry::get('admins'))){
                $link .= '<a href="' . $this->view->url(array('controller' => 'admin','action' => 'index'), 'default', true) . '">' . $this->view->translate('admin') . '</a>';
            }
        }
        return $link;
	}
}